<template>
    <div class="container-full">


        <div class="order-list-items">
            <van-list v-model="menLoading" :finished="menFinished" finished-text="没有更多了" @load="onLoadMenDian">
                <div v-for="(item,index) in menDianList" :key="index" class="list" @click="goList(item.id,0)">
                    <div>名称：{{item.zhicheng}}</div>
                    <div>电话：{{item.phone}}</div>
                </div>
            </van-list>
        </div>

    </div>
</template>

<script>
    import {Cell, CellGroup, Tab, Tabs, List} from 'vant';

    import NormalOrderList from '../../components/currency/order-item/normal-list-temporary-director.vue';
    import TabGroup from "../../components/currency/tab/tab.vue";
    import fly from "../../../src/libs/request.js"

    export default {
        name: 'salesmanIndexs',
        components: {
            [Cell.name]: Cell, [CellGroup.name]: CellGroup,
            [Tab.name]: Tab, [Tabs.name]: Tabs, [List.name]: List,
            NormalOrderList, TabGroup
        },
        data() {
            return {

                menDianList: [],
                menFinished: false,
                menLoading: false,
                menQuery: {
                    page: 0,
                    list_rows: 10,
                },


            }
        },
        methods: {
            goList(id, index) {
                this.$router.push({
                    path: `/public/yeji-detail/${id}/${index}`
                })
            },

            async onLoadMenDian() {
                let params = this.menQuery;
                params.token = this.$store.state.options.user.token;
                params.status = 2;
                let res = await fly.post("/api/home/user/getlist", params);
                if (res.code == 200) {
                    let data = res.data.data || [];
                    this.menDianList = this.menDianList.concat(data);
                    this.menQuery.page++;
                    if (this.menQuery.list_rows > data.length) {
                        this.menFinished = true
                    }
                } else {
                    this.menFinished = true
                }
                this.menLoading = false;
            },


        }
    }
</script>

<style lang="scss" scoped>

    .list {
        padding: 10px;
        font-size: 14px;
        border-bottom: 1px solid #EEEEEE;
    }

    .page-top {
        width: 100%;
        height: 3rem;
        position: relative;

        .notice {
            position: absolute;
            top: 0rem;
            width: 100%;
            margin: 0rem;
            padding: 0.7rem 1rem;
            display: flex;
            background: rgba(255, 247, 209, 1);
            z-index: 1;
            box-sizing: border-box;

            dt {
                padding-right: 1rem;

                img {
                    width: 1.4rem;
                }
            }

            dd {
                white-space: nowrap;
                flex: 1;
                margin: 0rem;
                padding: 0rem;
                color: #ff9000;
                font-size: 1.3rem;
            }
        }
    }

    .order-list-items {
        position: relative;
        margin-bottom: 4rem;

        .el-item {
            padding: 0.5rem 1rem;
        }
    }

    .order-list-contianer {
        border-bottom: 0.4rem solid #f4f4f4;

        ul {
            display: flex;
            border-bottom: 0.1rem solid #00cc00;

            li {
                padding: 1rem 0rem;
            }
        }

        ul li {
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;

            color: #999999;
            font-size: 1.7rem;
        }

        .active {
            background-color: #00cc00;
            color: #ffffff;
            font-weight: 540;
        }
    }
</style>
